<template>
<div>
  <van-field label="角色名" v-model="name"/>
  <van-button @click="add">添加</van-button>
</div>
</template>

<script>
export default {
  name: "add_roles",
  data(){
    return{
      name:''
    }
  },
  methods:{
    add(){
      this.$axios.post('admin/rolesM',{'name':this.name}).then(res=>{
        if(res.data.code==200){
          alert('ok')
        }else {
          alert(res.data.mes)
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
